elimination method for solving equations